<template xmlns="http://www.w3.org/1999/html">
  <sea-data-table ref="tableObject" url="/kettle/job/log/page">
    <!--表头-->
    <sea-table-header slot="header" disabled-form>
      <!--标题栏-->
      <sea-table-title slot="title" title="Kettle运行日志"
                      subtitle="Kettle原生日志列表，以作业ID进行关联。"></sea-table-title>
    </sea-table-header>

    <!-- 弹窗、抽屉 -->
    <panel slot="drawer" ref="panel"></panel>

    <!--表头-->
    <template slot="columns">
      <el-table-column property="idJob" label="作业ID " width="180"></el-table-column>
      <el-table-column property="channelId" label="通道ID" width="180" show-overflow-tooltip></el-table-column>
      <el-table-column property="jobname" label="作业名称" width="180"></el-table-column>
      <el-table-column property="status" label="作业状态" width="180"></el-table-column>
      <el-table-column property="errors" label="错误数量" width="180"></el-table-column>
      <el-table-column property="startdate" label="开始日期" width="180"></el-table-column>
      <el-table-column property="enddate" label="结束日期" width="180"></el-table-column>
      <el-table-column property="logdate" label="日志日期"></el-table-column>

      <!--操作栏-->
      <sea-table-actionbar width="280" :on-action="onAction" :buttons="buttons"></sea-table-actionbar>
    </template>
  </sea-data-table>
</template>

<script>
import Panel from "./item";

export default {
    components: {
        Panel
    }
    , name: 'TaskLogList'
    , data() {
        return {
            // 操作栏
            buttons: [
                {type: 'btn', evt: 'variable', label: '输入参数', title: '查看脚本运行采用的参数'}
                , {type: 'btn', evt: 'channel', label: '通道日志', title: '查看通道日志'}
                , {type: 'btn', evt: 'entry', label: '日志细项', title: '查看日志细项'}
                , {type: 'btn', evt: 'download', label: '日志文件', title: '下载日志文件'}
            ]
            // end--
        }
    }
    , methods: {
        /**
         * 操作成功回调
         */
        onSucceed: function () {
            this.$refs.tableObject.reload();
        }
        /**
         * 操作栏事件分发
         * @param evt 事件
         * @param row 行级对象
         * @param old 可供回滚的参数
         */
        , onAction: function (evt, row, old) {
            this.$refs.panel.onAction(evt, row, old);
        }
    }
}
</script>
